====================================================== These instructions are for getting XP (from a working XP / Linux dual boot system) to run as a VMware virtual machine while the system is booted into Linux. IMPORTANT! You will not be able to boot into XP and run Linux as a virtual machine (at least I haven't tried that). If you do, you'll likely screwup your Linux installation. NOTE: The hardware windows sees is very different between booting into vmware and booting on the bare metal. On a version of windows that needs to be activated, this hardware change usually causes windows to require re-activation. A way around this is to use a version of windows that does not require activation in the first place (like a corporate version). ====================================================== Revised: 2008-09-10 - This assumes you already have a working dual boot system with windows and linux. - If not then do it like this: - First install Windows (be sure to leave extra unpartitioned space on your drive for Linux) - Second install Linux (Linux should take care of the dual boot menu stuff with grub) - Boot into your Linux host and turn off the Grub timeout (this is for safety reasons) - In /boot/grub/menu.lst, comment out the timeout line: # timeout=30 - If you're going to run VMWare as a regular user, you need to ensure the user has permission to access the physical partition where the windows install resides. On Ubuntu/Debian, this should work: adduser bronson disk - Reboot into Windows - Create a separate hardware profile: - Control Panel -> System -> Hardware -> Hardware Profiles - Click Copy, then name the copy you just created VMWare - You should now have two hardware profiles, Physical and VMWare. - Ensure that "Wait until I select a hardare profile" is selected (Booting into the wrong hardware profile can be disastrous!) - Fix IDE stuff: - Create a text file called "MergeRegData.reg" - Cut and paste the registry data at the end of this file into MergeRegData.reg and save - Run MergeRegData.reg - Reboot into Linux - Launch VMware and create a new Virtual Machine: - Configure to you liking but be sure to: - Leave SCSI set to BusLogic - Use Physical Disk - Use individual partitions - Select the Windows partition (of course) - After the Virtual Machine is created: - Open the VM Settings window, click on Hardware -> Floppy - Select "Use a floppy image" - Click "Create" and create a new image. Call it bootdisk.img - Click "Connect at Power On" - Now add grub to the disk image file: $ dd if=/boot/grub/stage1 of=/Path/to/VM/bootdisk.img count=1 $ dd if=/boot/grub/stage2 of=/Path/to/VM/bootdisk.img seek=1 - We'll need the non-filesystem grub disk for later so back it up. $ cp /Path/to/VM/bootdisk.img /Path/to/VM/grubdisk.img - Now start up the VM. You should be dropped straight into Grub. - Try booting Windows using: grub> root (hd0,0) grub> chainloader +1 grub> boot - Of course, you need replace (hd0,0) with the location of your own windows partition. You can find the exact commands to use in /boot/grub/menu.lst. - You should now be booted into your Windows virtual machine. If not, you need to figure out what went wrong before proceeding. - We will now modify the boot disk to run those commands automatically whenever the VM is powered on. - You should still be running the Windows virtual machine. - Format the boot floppy. - Desktop -> My Computer - Right click the "A:" icon and choose "Format..." - Click start. The defaults are fine. - Shut down the VM - Mount the image under Linux and copy in the Grub files. You may need to be root to do some of these operations. $ mount /Path/to/VM/bootdisk.img /mnt -o loop $ mkdir -p /mnt/boot/grub $ cp /boot/grub/stage[12] /boot/grub/fat_stage1_5 /boot/grub/menu.lst /mnt/boot/grub $ vi /mnt/boot/grub/menu.lst (make the menu.lst look similar to the example below) $ chmod -R a-w /mnt/boot $ umount /mnt EXAMPLE of menu.lst: default 0 timeout 0 hiddenmenu title Windows XP root (hd0,0) makeactive chainloader +1 - Click "Edit Virtual Machine Settings" -> Hardware -> Floppy 1 and tell VMWare to boot using grubdisk.img (the copy we made earlier). - Click OK - Turn on the virtual machine. - You will be dropped into the Grub prompt. - Don't type anything! - Switch the floppy in the virtual floppy drive to bootdisk.img. - VM menu -> Settings -> Hardware -> Floppy 1 and type the bootdisk.img into the textbox. - The disk is switched when you hit OK. - Type the setup command: grub> setup (fd0) - Reset the virtual machine. - VMWare will now try to boot from bootdisk.img instead of hda's master boot block, and bootdisk.img should send you straight into Windows. - Now that VMWare isn't using your master Grub configuration, and there's no danger of VMWare booting into the Unix partition, you can re-enable the timeout in /boot/grub/menu.lst for you Linux host. - Done! ========================================== Data for "MergeRegData.reg" - Cut and paste everything below this line: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\primary_ide_channel] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="atapi" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\secondary_ide_channel] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="atapi" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*pnp0600] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="atapi" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*azt0502] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="atapi" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\gendisk] "ClassGUID"="{4D36E967-E325-11CE-BFC1-08002BE10318}" "Service"="disk" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_1222] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_1230] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_2411] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_2421] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_7010] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_7111] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\pci#ven_8086&dev_7199] "ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}" "Service"="intelide" ;Add driver for Atapi (requires Atapi.sys in Drivers directory) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\atapi] "ErrorControl"=dword:00000001 "Group"="SCSI miniport" "Start"=dword:00000000 "Tag"=dword:00000019 "Type"=dword:00000001 "DisplayName"="Standard IDE/ESDI Hard Disk Controller" "ImagePath"=hex(2):53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,52,00,49,00,56,00,45,00,52,00,53,00,5c,00,61,00,74,00,61,00,70,00,69,00,2e,00,73,00,79,00,73,00,00,00 ;Add driver for intelide (requires intelide.sys in drivers directory) [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IntelIde] "ErrorControl"=dword:00000001 "Group"="System Bus Extender" "Start"=dword:00000000 "Tag"=dword:00000004 "Type"=dword:00000001 "ImagePath"=hex(2):53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,44,00,52,00,49,00,56,00,45,00,52,00,53,00,5c,00,69,00,6e,00,74,00,65,00,6c,00,69,00,64,00,65,00,2e,00,73,00,79,00,73,00,00,00